UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82ZGWLeQf8YvytTYa8qfFh6lVMyKhrtC48dAAe+bmLY=' 
WHERE 
  key_id = '1861b377e2fa8718c33b138364339d40320ccf96d72de4bda0986831024e7e01' 
  AND (
    token = '82ZGWLeQf8YvytTYa8qfFh6lVMyKhrtC48dAAe+bmLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072