UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v9Zn+B1bkC5Lo/5SAgEXEdYcRo0OvqNTwCzCOsfBWQQ='
WHERE
key_id = '340dc2a5d1f1c8d3d0e49b232bbe7ab1e7e4731d0f9317577ea85cd2194834e6'
AND (
token = 'v9Zn+B1bkC5Lo/5SAgEXEdYcRo0OvqNTwCzCOsfBWQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)