UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0my+B6ODq7BBJcej+pzKEKPSoK0JCMJpLCOIfvpSJa4=' 
WHERE 
  key_id = '5fcdd1554dccbe039a81cc06c3049e24e53e1c8a682b7e843a25974171d6d09b' 
  AND (
    token = '0my+B6ODq7BBJcej+pzKEKPSoK0JCMJpLCOIfvpSJa4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036