UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DGdHvz4dXP0lndF/F9k6gQ504bKxRqfwmPI1bkXS/gs=' 
WHERE 
  key_id = '629dfe1f0a15d8aa16f28e2f3fcbf0be4841ef3ee9ab250ea724199700045429' 
  AND (
    token = 'DGdHvz4dXP0lndF/F9k6gQ504bKxRqfwmPI1bkXS/gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015