UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jS6Xm9uSGwQ6y+5dbrioKcJHOVHQqz65q4fzecxsUq8='
WHERE
key_id = '8e142120597fc94fd7c8809bcd8c7bdb5c025ac19b485ce96d9eee4379d96c0d'
AND (
token = 'jS6Xm9uSGwQ6y+5dbrioKcJHOVHQqz65q4fzecxsUq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)