UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zXA2hJh5hrEglrL7m3BM5DXy1YJEwGk4zRY6vEM9Zyo='
WHERE
key_id = '9cd63712500fd29437616b94988c8f6a98cade7dce8dfbe74d2bc45eea44c4dc'
AND (
token = 'zXA2hJh5hrEglrL7m3BM5DXy1YJEwGk4zRY6vEM9Zyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)