UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EqwbK4nMJMiCi6jTmH5vNpnWt4+UyYxs7DH7Br9fHO8=' 
WHERE 
  key_id = '06b41b8d77b20664e676a1efc4c62059d1451713db6e2ebc546158c1ad91b44a' 
  AND (
    token = 'EqwbK4nMJMiCi6jTmH5vNpnWt4+UyYxs7DH7Br9fHO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017