UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bIgbF3qHyjKnyIKmhUhD5sLqxdUZxyLzTTPh64JLRvE='
WHERE
key_id = '961a4292f79556192b3cb9a6cf394086eae70a040346198ba21d872eb4f2a121'
AND (
token = 'bIgbF3qHyjKnyIKmhUhD5sLqxdUZxyLzTTPh64JLRvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)