UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0tTzJiWk0MGct6wHG2ylypDtyKwcbSRLwVhA6zIx+bI=' 
WHERE 
  key_id = '957e6519a360ffc2b842b38bab41913e27885731923703282c04901cd66f8eae' 
  AND (
    token = '0tTzJiWk0MGct6wHG2ylypDtyKwcbSRLwVhA6zIx+bI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032