UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFDjYrYjMfS0Su6Jp+MXGelrrYa3+5y0fMlBYHMZltQ=' 
WHERE 
  key_id = '0f9bf6d9ee38b8eb1655e5e31547715858f263dd4e9ec06ecc361a721be671b0' 
  AND (
    token = 'OFDjYrYjMfS0Su6Jp+MXGelrrYa3+5y0fMlBYHMZltQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00153