UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nuuf9D3WK94jLV/7O8nwejxILMMHQqr7cW2CLK7PnJE='
WHERE
key_id = '7ee5fc96a92ebaa0f454f52fceece9ec01df984d6a7e5cacbafe44917ff66fe3'
AND (
token = 'nuuf9D3WK94jLV/7O8nwejxILMMHQqr7cW2CLK7PnJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)