UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PXeH8KXGlfBNW45yeH32NwF/oApMKUFiPv+Qp81D478=' 
WHERE 
  key_id = '88a23b39a9876a7eb49b7730c8709ed7cd8ffd15df88e6e99ad66fcc3ab2f75e' 
  AND (
    token = 'PXeH8KXGlfBNW45yeH32NwF/oApMKUFiPv+Qp81D478=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043