UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDwh1nxZxo4uZ2HU+e3EdqQlrpSQyHOIH1Hx5peSZMw=' 
WHERE 
  key_id = '625a7ea1fc50c5f8b549bb8450ee8977f1b0e252da60006a51f43b32181aacbe' 
  AND (
    token = 'pDwh1nxZxo4uZ2HU+e3EdqQlrpSQyHOIH1Hx5peSZMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025