UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jS22sPvEUCOLBvSsQi55Kl1t9hnjIaJEmk06cfLkvLI=' 
WHERE 
  key_id = '2abe628cb91a87b8687c46619545654432ed351ef1c11624f4c0d4cc910f48a6' 
  AND (
    token = 'jS22sPvEUCOLBvSsQi55Kl1t9hnjIaJEmk06cfLkvLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016