UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LQG7EfZjjdC/ycW/HPu7XY1i99PHjwyJ/ZQrxA1TJTo=' 
WHERE 
  key_id = 'bb40fdcc907c59f326d72ca30b8899a2a15dfa367a4dd5ce75814a49ac794a99' 
  AND (
    token = 'LQG7EfZjjdC/ycW/HPu7XY1i99PHjwyJ/ZQrxA1TJTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047