UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/rnpxxCZYt09LzehAwcNWAZoepXR2U+xmyo/0eXwDt4=' 
WHERE 
  key_id = '61b42c4d59e7c7992856b957d2bfe499e9d562bc49c04d50e11f327e31492427' 
  AND (
    token = '/rnpxxCZYt09LzehAwcNWAZoepXR2U+xmyo/0eXwDt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028