UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uIuoYxhfiTB/YAu16ujeWigC1zqNzqblGlWuPb7CPFA=' 
WHERE 
  key_id = '4062ed2e90701b1894695315dda6b14af1866cb39796cf621d4e67c8c08e3d7c' 
  AND (
    token = 'uIuoYxhfiTB/YAu16ujeWigC1zqNzqblGlWuPb7CPFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037