UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fqb5S1CE+QL8bPojj3qqJB5E3+Yyoaohwi4MYUTcHAM=' 
WHERE 
  key_id = '038ce66b9c129ba787476318da613c92455cf0e0e548188256605ddf576f685d' 
  AND (
    token = 'Fqb5S1CE+QL8bPojj3qqJB5E3+Yyoaohwi4MYUTcHAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029