UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w2Wt1ETdZsWg1I8lzsHQvvUVXR7HmE5cCwc01kggboE=' 
WHERE 
  key_id = '1713addfe9edec2e49d6ac9e19b10e3064a4ac7e84884b06bdf5dcf86ff18c79' 
  AND (
    token = 'w2Wt1ETdZsWg1I8lzsHQvvUVXR7HmE5cCwc01kggboE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033