UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uzPoG+aFM33qu1RbC8t7PHpHULKzRthRcY9SpnMWPDw='
WHERE
key_id = 'abc81276cf98df7a0c0d613a937424ab1e57c2d3eb808ab680b2c5f95abb85a4'
AND (
token = 'uzPoG+aFM33qu1RbC8t7PHpHULKzRthRcY9SpnMWPDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)