UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gtQ+xvBTKxN2E7kxS6uYHjCf35gUOHcK2XcRNRzCw5o='
WHERE
key_id = '2b14601fefac7caf4367be9d44c3423918a7b49844693726331283f168172d54'
AND (
token = 'gtQ+xvBTKxN2E7kxS6uYHjCf35gUOHcK2XcRNRzCw5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)