UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FwMKKZ2h8xh3GPLx2TOmBhdQJTwKwVx5Lr0+0zv5vgs=' 
WHERE 
  key_id = '4da47a6d201ad66e45b1123a1602f426e60f52f84a3c36238f9da0f4b2ef84fb' 
  AND (
    token = 'FwMKKZ2h8xh3GPLx2TOmBhdQJTwKwVx5Lr0+0zv5vgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030