UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1iT0qyhEULy68mWbdlFyVXOOJvbe6zEg0pWH4LWZ954='
WHERE
key_id = '02897887dceddc5f50c6709206aada812d6508a7968daca02dab86569376852a'
AND (
token = '1iT0qyhEULy68mWbdlFyVXOOJvbe6zEg0pWH4LWZ954='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)