UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TzlvQHH8FBv5q3/SHddrF/3MWFjbFY39RzePiAvklG8=' 
WHERE 
  key_id = '73ce414f53a9f30dd177d02f25d0fcc6c34079acafec61ae76fb382495a8779c' 
  AND (
    token = 'TzlvQHH8FBv5q3/SHddrF/3MWFjbFY39RzePiAvklG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075