UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ShjoWMb9/+fnFCX3XP1jlxOyzT5hYg7XVg45TVgyBwc='
WHERE
key_id = '1ea5bd1f254f7ac1c1aeb746bea3357c477b8fd46545fe14afd6ccd98d2af8f2'
AND (
token = 'ShjoWMb9/+fnFCX3XP1jlxOyzT5hYg7XVg45TVgyBwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)