UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HfkJqsiJ2CtmDgoDSFPdbtpPCCraxHA6Xdf0PvU/6Io='
WHERE
key_id = '25acf5380933feed026876bcffbd2d617dd5bcd9fc09738866dd2b1cb134e247'
AND (
token = 'HfkJqsiJ2CtmDgoDSFPdbtpPCCraxHA6Xdf0PvU/6Io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)