UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+yjddaDjYmC0g2loiE8u69TbK8Gemv2K84AOx6JPy38='
WHERE
key_id = '72fb568d4927221e3b9df6b175b53ee66c5ebbc2b58c8ea6a72ea16620baa713'
AND (
token = '+yjddaDjYmC0g2loiE8u69TbK8Gemv2K84AOx6JPy38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)