UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rMBB1ziFavQg3fzs+D3wUsphCNDUmBP0amHxxK4pzcc=' 
WHERE 
  key_id = 'd4846c4c80952475542eaee49a18a24d23911af430cdcfdaa03e69c3c4b7d35d' 
  AND (
    token = 'rMBB1ziFavQg3fzs+D3wUsphCNDUmBP0amHxxK4pzcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029