UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zltH+P+HzuwxzDW6mrZrZd9xRU34OUfWwba5RHdqIB0=' 
WHERE 
  key_id = '821fad87ef3bd744962a1e4a6aa489bbe3d5d787022bd379dffd27dd1d71b9fa' 
  AND (
    token = 'zltH+P+HzuwxzDW6mrZrZd9xRU34OUfWwba5RHdqIB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036