UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Z6BN6ojwIvL1/OJcG5ZC3RpH3FBrsFjfTcrpiY1AXY='
WHERE
key_id = '11281c24a4be73668723e3cb47517a6ef8efbbf6eb8d88ae299d877d094ad2a4'
AND (
token = '/Z6BN6ojwIvL1/OJcG5ZC3RpH3FBrsFjfTcrpiY1AXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)