UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6nVAByI8bg6HWQ0f+JSYDU2zKglQCO60zxfO0bUBX2s=' 
WHERE 
  key_id = 'b191e1da628c86911632a0e160ea017c0fb8565297ae66d60e668b77aaeab3cd' 
  AND (
    token = '6nVAByI8bg6HWQ0f+JSYDU2zKglQCO60zxfO0bUBX2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033