UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7b5PNXlpB5oWIMsPJw6R6eNq7CDOQI9p5FG2vmz9/bE='
WHERE
key_id = '9051ffbd846cc6a7ecf4de024bb60797f4c4d9337bc6300605cb81973d484d7a'
AND (
token = '7b5PNXlpB5oWIMsPJw6R6eNq7CDOQI9p5FG2vmz9/bE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)