UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3qPqcYMFgVU45wb4GrI+TGAefpExHonhdB3ZPPZY3P4=' 
WHERE 
  key_id = '2e2e865b8cf1efa2ed10ea396ee1f7d9f606bc87a02a024ea0a9881f21ed9f70' 
  AND (
    token = '3qPqcYMFgVU45wb4GrI+TGAefpExHonhdB3ZPPZY3P4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021