UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v0D193+NkAOcFYpmCMGAzRzPKxasy+V2hl/MEjgLSBo=' 
WHERE 
  key_id = 'bbbc66440cb25f6325d0f00ad202be8cb1d7f1e72c164fc0dbd5d14fc8c578a9' 
  AND (
    token = 'v0D193+NkAOcFYpmCMGAzRzPKxasy+V2hl/MEjgLSBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033