UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hwYtS0xtTcBpGBb6A7QBti6REiZLL6cGTpEWO/BIQtA=' 
WHERE 
  key_id = 'd4c107fafcfa72890311aa5fdce42e7cc9c31706280021b5fa9427e592b11d84' 
  AND (
    token = 'hwYtS0xtTcBpGBb6A7QBti6REiZLL6cGTpEWO/BIQtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050