UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NQ6+QVSb8j+5QrYLH1lXRX/JUP8XZSp/D3BnzCEvPgc=' 
WHERE 
  key_id = '1dbd1d737dffacdf7779036c6e9b6c8e9e6142aba3e13a20d17e3ccd545848eb' 
  AND (
    token = 'NQ6+QVSb8j+5QrYLH1lXRX/JUP8XZSp/D3BnzCEvPgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049