UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60hGamJ123s5oPe4zV/MLrcneiZrHrgXiScStMxGNRk='
WHERE
key_id = '974f99a98efff28163505d3240a78fcd8bb211d4530fee7968f54e32bf8b4cb5'
AND (
token = '60hGamJ123s5oPe4zV/MLrcneiZrHrgXiScStMxGNRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)