UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P81WWxFZEmyA4tJY+UmvWmPyzM66XveNhesq3ZjwSvs=' 
WHERE 
  key_id = '95b3a3be7c2f6d9b5e335df299692c215509236ae4fc3f0a7fef97c41a2d5cb2' 
  AND (
    token = 'P81WWxFZEmyA4tJY+UmvWmPyzM66XveNhesq3ZjwSvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032