UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eEzXYvabmN6e1NDz3U+2zfzGuYzr+vl6T8Rp83Wcodc=' 
WHERE 
  key_id = '64a598fb27ae5a8d12210ffb134812a1da67b255e15cc093706ca397916b13b5' 
  AND (
    token = 'eEzXYvabmN6e1NDz3U+2zfzGuYzr+vl6T8Rp83Wcodc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017