UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IgBLbjzH6tYs++/sCqhHlLBa2fP9ZKRVFbs841jyxIU=' 
WHERE 
  key_id = 'fe8cd27bde0172dcd843d92be5f30a90417c480dfb1681e43e8c4a1a9982ce17' 
  AND (
    token = 'IgBLbjzH6tYs++/sCqhHlLBa2fP9ZKRVFbs841jyxIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025