UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tFZx4uVuN7spXcuPLC4tTeUKfZRmdNUm3dJHlzcrXUM=' 
WHERE 
  key_id = '437dff2b6533c8c2c2503b1f49d8363a5bca84b277e5c1953a29f451bf05137a' 
  AND (
    token = 'tFZx4uVuN7spXcuPLC4tTeUKfZRmdNUm3dJHlzcrXUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031