UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wodzPmdvRL4JrlEeZyVc+yrLIMthFvloi1Jrz4bGzc4=' 
WHERE 
  key_id = 'f96431961a99db5f8340472fd7ed03626ad22e5731e19999f58803215f3f2a51' 
  AND (
    token = 'wodzPmdvRL4JrlEeZyVc+yrLIMthFvloi1Jrz4bGzc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036