UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/2fo4pmZ591BJQPDW1TvG42mDVS/8Gtqqo29LpNbCNA='
WHERE
key_id = 'f3f87b7f176ebe408c2f0aad827a366b5912c34e0ea785875362ce05fd2c4239'
AND (
token = '/2fo4pmZ591BJQPDW1TvG42mDVS/8Gtqqo29LpNbCNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)