UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6mohKFcZnELSQg5J6FQi/wFWSwtAA9ta7lkJzXCSTjg='
WHERE
key_id = '9c0ad173bb0272fb273e655ba87ab2673aa744f723cd730179e8626100f8ba80'
AND (
token = '6mohKFcZnELSQg5J6FQi/wFWSwtAA9ta7lkJzXCSTjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)