UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIA25C7IIF3D5Q5Fg6Ttqkp9VWxq/Trz8aD25JjVaNs='
WHERE
key_id = '99b45f7a535846ceee95fc0e60418036185c8f6847b0f20983a9fe728bea0cd9'
AND (
token = 'kIA25C7IIF3D5Q5Fg6Ttqkp9VWxq/Trz8aD25JjVaNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)