UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uy4mzwddIyq38FTY0k+37lS29pHnn5cjYmT82wc9XY4='
WHERE
key_id = '7b44be70a1499bef7eaab3cf749fd1c3eb2c7eae1dbf5855316936cc952ebee5'
AND (
token = 'Uy4mzwddIyq38FTY0k+37lS29pHnn5cjYmT82wc9XY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)