UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p1jMNvl3i6XgRco80aLS3+BC8DU05p2gr3ZQ2KCZ+s4='
WHERE
key_id = '3ed907001f79343e98eae5cab4f15727b3821b9bd7e04fce722cbdba27bd5edf'
AND (
token = 'p1jMNvl3i6XgRco80aLS3+BC8DU05p2gr3ZQ2KCZ+s4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)