UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c/RjCl1hlpn5SbxsR2no27l7yQ7Sj6K3D3pL0+GqqXQ=' 
WHERE 
  key_id = 'fba7ba9190343dff2fa5dbdda86263c9a35d4dbf9b7326849a6b7b7942f1a805' 
  AND (
    token = 'c/RjCl1hlpn5SbxsR2no27l7yQ7Sj6K3D3pL0+GqqXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036