UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b5Px0azWiYUsmFNuYzFh8t/eL4l44X8LO5aNNueNcvs='
WHERE
key_id = '2e7a7cb4957a91a4caf159a084e01617cdb2ab99298adb12ef9eacdad72b21df'
AND (
token = 'b5Px0azWiYUsmFNuYzFh8t/eL4l44X8LO5aNNueNcvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)