UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jlKqXBYtT7khHdiCar/EzwVRCMFOk4x95eOIOgCBN60=' 
WHERE 
  key_id = '868514ddd0f38828c9336995f59e1dc5a59873b91f6b8048642278460685ced4' 
  AND (
    token = 'jlKqXBYtT7khHdiCar/EzwVRCMFOk4x95eOIOgCBN60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025