UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhpxSQEFGM9CAB0zlMkXwDLx16D4FrDUOFTw/BJSpPM=' 
WHERE 
  key_id = 'dc58bf4c746448bd42a25561a49889c6873f691d7f83430cb1e574ace39f6fec' 
  AND (
    token = 'DhpxSQEFGM9CAB0zlMkXwDLx16D4FrDUOFTw/BJSpPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039