UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g0gbeUzPZGY9Wx9zhprMokgdGZtLTWfDCzfDQfdWySI='
WHERE
key_id = '19dc807f7efce6ced272fb842b9ab228fc905aaf4e7b1b2c68532ec797e175ab'
AND (
token = 'g0gbeUzPZGY9Wx9zhprMokgdGZtLTWfDCzfDQfdWySI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)