UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'amzXmCvYQeP6uukSRBKt16U78ElFgOMHHInSTXytq00=' 
WHERE 
  key_id = '469451e78a61fd95b12398bca8845befefda60d687e3393b2c0bcbf6442cb4b0' 
  AND (
    token = 'amzXmCvYQeP6uukSRBKt16U78ElFgOMHHInSTXytq00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022