UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pAnczQUEVsKsuYodPAz/uVgmR7DV23w7YSbnXfyxCJw='
WHERE
key_id = '38708ea1b1057342f4285e724f3c4e30ece81e2df52c62c09213c2185bacedce'
AND (
token = 'pAnczQUEVsKsuYodPAz/uVgmR7DV23w7YSbnXfyxCJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)