UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f7GV3PpaR+bCbZu9JsaoPLn9YDg7rh0LzaOCUxkpxfI=' 
WHERE 
  key_id = 'ef33545eff8830ddbd85344aee9672613d1999f909983f80c8be090d8a9fbdb5' 
  AND (
    token = 'f7GV3PpaR+bCbZu9JsaoPLn9YDg7rh0LzaOCUxkpxfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031