UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3WsnOyiuD0LY7oKgaz3GTjJF37b2GokaAhvujXSGGmk='
WHERE
key_id = '906b7095892e029b0f9564c33b8c3846522d191021a1d8e70b7ee4556bdb6f17'
AND (
token = '3WsnOyiuD0LY7oKgaz3GTjJF37b2GokaAhvujXSGGmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)