UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KyfRrm4DsDWBYc33cPu1LRI5i8H0iNDWTR8Nj+izTXk=' 
WHERE 
  key_id = '7637a54c6ba238bdebe6d0033ebdecc5b509fe9d5a9dc35f20c7a85c61c71c04' 
  AND (
    token = 'KyfRrm4DsDWBYc33cPu1LRI5i8H0iNDWTR8Nj+izTXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041