UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ikDeFJ7Fg+FkJFeAeLkM+RT7iIlh2RmjssG9MO1XaH4='
WHERE
key_id = 'dc99a07a9f0f50a61caea51d569bc5d4422cf0bf31b07dc286ac506f15393c04'
AND (
token = 'ikDeFJ7Fg+FkJFeAeLkM+RT7iIlh2RmjssG9MO1XaH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)