UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xzUj/mGsPhyk6YEvjeNNQWCUf30jOBhKqzFyjE+WbcY=' 
WHERE 
  key_id = '2cfc1778fc03acab2167dea92e1cfb4dd6f176409a632edae88f95e2dc5a28a1' 
  AND (
    token = 'xzUj/mGsPhyk6YEvjeNNQWCUf30jOBhKqzFyjE+WbcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038