UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g4/X2avcJljFt7BF3bmnW+drd9Fk9g14Buh3z2z1I90=' 
WHERE 
  key_id = 'ef081edf642ceb5a0ac29340c4a6e012130f4d0790704bd987dccab34b77aa8e' 
  AND (
    token = 'g4/X2avcJljFt7BF3bmnW+drd9Fk9g14Buh3z2z1I90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042