UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7x8nez2LsjXfVIL534de74ISIs61wNXQWpcaUJJS3Gg='
WHERE
key_id = '7060732278d437bdf7225799c2e45f0066c44bc0e69a89d5fff02bb0f8551d7b'
AND (
token = '7x8nez2LsjXfVIL534de74ISIs61wNXQWpcaUJJS3Gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)